package com.heqiang.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConfigController {
    @Value("${url}")
    private String url;

    @Autowired
    Environment environment;

    @RequestMapping("/url")
    public String get() {
        return url;
    }

    @RequestMapping("/getUrl")
    public String getUrl() {
        return environment.getProperty("url");
    }
}
